#ifndef _MY_WATCH_H
#define _MY_WATCH_H

#include <Arduino.h>
#include <ESP32Encoder.h>

#include "FS.h"
#include "SPIFFS.h"

//固件版本号
#define Firmware_version "V 1.0.0"

//是否开启debug功能
const unsigned long BAUD_RATE = 115200;  //波特率

#define DEBUG

#ifdef DEBUG
#define DebugPrintln(message) Serial.println(message)
#else
#define DebugPrintln(message)
#endif

#ifdef DEBUG
#define DebugPrint(message) Serial.print(message)
#else
#define DebugPrint(message)
#endif

//星座信息

//默认WIFI信息
char ssid[] = "liuzewen";
char pswd[] = "17609245102liu";

//-----------------------GPIO配置-----------------------------
// LED配置
#define LED_PIN 2
#define LED_OFF digitalWrite(LED_PIN, HIGH)
#define LED_ON digitalWrite(LED_PIN, LOW)
#define LED_PWM digitalWrite(LED_PIN, !digitalRead(LED_PIN))

//蜂鸣器配置
#define BEEP_PIN 15
#define BEEP_ON digitalWrite(BEEP_PIN, HIGH)
#define BEEP_OFF digitalWrite(BEEP_PIN, LOW)
#define BEEP_PWM digitalWrite(BEEP_PIN, !digitalRead(BEEP_PIN))

//蜂鸣器配置
#define PD_CTRL_PIN 26
#define PD_ON digitalWrite(PD_CTRL_PIN, HIGH)
#define PD_OFF digitalWrite(PD_CTRL_PIN, LOW)
#define PD_PWM digitalWrite(PD_CTRL_PIN, !digitalRead(PD_CTRL_PIN))

#define FUSB302_INT_PIN 25

#define BOOT_K_PIN 0

// //按键配置
// #define EC11_A_PIN 13
// #define EC11_B_PIN 14
// #define EC11_K_PIN 27

// //屏幕宽长
// static const uint32_t screenWidth = 240;
// static const uint32_t screenHeight = 240;

//按键配置
#define EC11_A_PIN 39
#define EC11_B_PIN 34
#define EC11_K_PIN 0

//屏幕宽长
static const uint32_t screenWidth = 240;
static const uint32_t screenHeight = 135;

ESP32Encoder encoder;

hw_timer_t* tim1 = NULL;

static const long key_long_press_time = 500;

#endif /* _MY_WATCH_H */